/*
 * 常用工具
 *
 * @Author:    天青飞扬
 * @Wechat:    18576228047
 * @Email:     1787585212@qq.com
 * @Date:      2024-09-06 20:46:03
 */

import _ from 'lodash'

export function deepCopy(target, source) {
    if (_.isArray(target)) {
        target.forEach((targetValue, key) => {
            target[key] = deepCopy(targetValue, source[key])
        })
    } else if (_.isObject(target)) {
        Object.keys(target).forEach((key) => {
            target[key] = deepCopy(target[key], source[key])
        })
    } else {
        return source
    }
}